local skel = fk.CreateSkill {
  name = "emo__maoxian",
  tags = {Skill.Wake},
}

skel:addEffect(fk.EventAcquireSkill, {
  can_trigger = function (self, event, target, player, data)
    return player:hasSkill(skel.name) and target == player and player:usedSkillTimes(skel.name, Player.HistoryGame) == 0
  end,
  on_cost = Util.TrueFunc,
  can_wake = function (self, event, target, player, data)
    return player:getMark(skel.name) >= 3
  end,
  on_use = function (self, event, target, player, data)
    player.room:delay(500)
  end,
})

skel:addEffect(fk.EventAcquireSkill, {
  can_refresh = function (self, event, target, player, data)
    local count = player.room:getBanner("RoundCount")
    if not count or count == 0 then return false end
    if player:hasSkill(skel.name, true) and target == player and player:usedSkillTimes(skel.name, Player.HistoryGame) == 0 then
      local skill = data.skill
      return skill.visible and skill:isPlayerSkill(player) and not skill.is_delay_effect
    end
  end,
  on_refresh = function (self, event, target, player, data)
    player.room:addPlayerMark(player, skel.name, 1)
  end,
})

Fk:loadTranslationTable{
  ["emo__maoxian"] = "冒险",
  [":emo__maoxian"] = "觉醒技，当你累计获得过三个技能后，“入梦”改为可选发动，“梦游仙境”不再移除技能。",
}

return skel
